#include "touchbutton.h"
#include "touchbuttonplugin.h"

#include <QtPlugin>

TouchButtonPlugin::TouchButtonPlugin(QObject *parent)
    : QObject(parent)
{
    m_initialized = false;
}

void TouchButtonPlugin::initialize(QDesignerFormEditorInterface * /* core */)
{
    if (m_initialized)
        return;

    // Add extension registrations, etc. here

    m_initialized = true;
}

bool TouchButtonPlugin::isInitialized() const
{
    return m_initialized;
}

QWidget *TouchButtonPlugin::createWidget(QPushButton *parent)
{
    return new TouchButton(parent);
}

QString TouchButtonPlugin::name() const
{
    return QLatin1String("TouchButton");
}

QString TouchButtonPlugin::group() const
{
    return QLatin1String("");
}

QIcon TouchButtonPlugin::icon() const
{
    return QIcon(QLatin1String(":/按钮.png"));
}

QString TouchButtonPlugin::toolTip() const
{
    return QLatin1String("");
}

QString TouchButtonPlugin::whatsThis() const
{
    return QLatin1String("");
}

bool TouchButtonPlugin::isContainer() const
{
    return false;
}

QString TouchButtonPlugin::domXml() const
{
    return QLatin1String("<widget class=\"TouchButton\" name=\"touchButton\">\n</widget>\n");
}

QString TouchButtonPlugin::includeFile() const
{
    return QLatin1String("touchbutton.h");
}
#if QT_VERSION < 0x050000
Q_EXPORT_PLUGIN2(touchbuttonplugin, TouchButtonPlugin)
#endif // QT_VERSION < 0x050000
